package edu.ccut.saturn.basecomponent.database.impl.sqlserver.builder.unused;

import edu.ccut.saturn.basecomponent.database.ISaturnSQL;
import edu.ccut.saturn.basecomponent.database.SaturnSQLBuilderFactory;
import edu.ccut.saturn.basecomponent.database.impl.AbstractUpdateSQLBuilder;
import edu.ccut.saturn.component.IDataItem;

public class OracleUpdateSQLBuilder extends AbstractUpdateSQLBuilder {

	@Override
	protected String getSetValueString(IDataItem iDataItem, Object value) {
		StringBuffer setValueString =new StringBuffer();
		setValueString.append(iDataItem.getColumn()) ;

		// 处理日期
		if ("DATE".equals(iDataItem.getType())) {
			setValueString.append("=to_date('").append(value).append(
					"','yyyy-mm-dd hh24:mi:ss')");
		} else {
			setValueString.append("='").append(value).append("'");
		}
		return setValueString.toString();
	}

	@Override
	protected String getDatabaseType() {
		return SaturnSQLBuilderFactory.ORACLE;
	}

	@Override
	protected String getOperationType() {
		return ISaturnSQL.UPDATE_OPERATION;
	}

//	@Override
//	protected boolean isNumber(String type) {
//		return OracleAttribute.isNumber(type);
//	}

}
